package polymorphic.exer1;

/**
 * Created with IntelliJ IDEA.
 * ClassName: MyRectangle
 * Package: polymorphic.exer1
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-11-22
 * Time: 21:15
 */

public class MyRectangle extends GeometricObject {

    //宽
    private double width;

    private double height;

    public MyRectangle(String color, double weight, double width, double height) {
        super(color, weight);
        this.width = width;
        this.height = height;
    }

    @Override
    public double findArea() {
        return width * height;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
}
